.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
  overflow: hidden;
}

.chat-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #171729;
  pointer-events: none;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  z-index: 100;
  position: relative;
}
.left-head{
  display: flex;
  border: 1px solid rgba(120, 119, 198, 0.4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.window-footer {
  position: relative;
  margin: auto;
  justify-content: center;
  align-items: center;
  z-index: 100;
  color: #888;
  font-size: 12px;
}
/* 侧边栏复原按钮样式 */
.restore-sidebar-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(120, 119, 198, 0.4);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  color: #7877c6;
  transition: all 0.3s ease;
}

.restore-sidebar-btn:hover {
   transform: scale(1.05);
}

.restore-sidebar-btn svg {
  width: 18px;
  height: 18px;
}
.model-choose {
  border: none;
  display: flex;
  align-items: center;
  position: relative;
}

/* 自定义下拉组件样式 */
.custom-select {
  position: relative;
  min-width: 200px;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(120, 119, 198, 0.4);
  border-radius: 6px;
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 36px;
}

.select-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(120, 119, 198, 0.6);
}

.dropdown-arrow {
  transition: transform 0.3s ease;
}

.dropdown-arrow.rotated {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(30, 30, 46, 0.95);
  border: 1px solid rgba(120, 119, 198, 0.4);
  border-radius: 6px;
  margin-top: 4px;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.2s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(120, 119, 198, 0.2);
}

.model-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.model-name {
  font-size: 14px;
  font-weight: 500;
  color: #e0e0e0;
}

.model-provider {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.delete-model-btn {
  background: none;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s ease;
  opacity: 0.7;
}

.delete-model-btn:hover {
  background: rgba(255, 107, 107, 0.2);
  opacity: 1;
}
.info {
  height: 30px;
  width: 30px;
  display: flex;
  align-items: center;
  
  &:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
  }
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
  position: relative;
  z-index: 1;
}


.message {
  display: flex;
  margin-bottom: 20px;
  animation: fadeInUp 0.5s ease-out;
}

.message.user {
  justify-content: flex-end;
}

.message.ai {
  justify-content: flex-start;
}


.message.user .avatar {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  order: 2;
}

.message.user .content {
  background: linear-gradient(135deg, #2d2d3d 0%, #3a3a4a 100%);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.message.ai .content {
  width: 100%;
  background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3a 100%);
}

.content {
  max-width: 100%;
  padding: 15px 20px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.message-text {
  line-height: 1.6;
  font-size: 14px;
  word-wrap: break-word;
}

.error-message {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  font-size: 12px;
  color: #ff6b6b;
}

.message.loading .content {
  background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3a 100%);
  border: 1px solid rgba(120, 119, 198, 0.2);
}

.message.streaming .content {
  background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3a 100%);
  border: 1px solid rgba(120, 119, 198, 0.4);
  box-shadow: 0 4px 20px rgba(120, 119, 198, 0.2);
  animation: pulse 2s infinite;
}

.message.streaming .message-text {
  position: relative;
}

.message.streaming .message-text::after {
  content: '▋';
  animation: blink 1s infinite;
  color: #7877c6;
  margin-left: 2px;
}

/* Markdown样式 */
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4,
.message-text h5,
.message-text h6 {
  color: #cdd6f4;
  margin: 1em 0 0.5em 0;
  font-weight: 600;
  line-height: 1.3;
}

.message-text h1 {
  font-size: 2em;
  border-bottom: 1px solid #45475a;
  padding-bottom: 0.3em;
}

.message-text h2 {
  font-size: 1.7em;
  border-bottom: 1px solid #45475a;
  padding-bottom: 0.2em;
}

.message-text h3 {
  font-size: 1.4em;
}

.message-text p {
  line-height: 1.6;
}

.message-text ul,
.message-text ol {
  margin: 0.8em 0;
  padding-left: 1.5em;
}

.message-text li {
  margin: 0.3em 0;
  line-height: 1.5;
}

.message-text blockquote {
  border-left: 4px solid #7877c6;
  background: rgba(120, 119, 198, 0.1);
  margin: 1em 0;
  padding: 0.8em 1em;
  border-radius: 4px;
  font-style: italic;
}

.message-text code:not(pre code) {
  background: rgba(137, 180, 250, 0.15);
  color: #89b4fa;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 0.85em;
  border: 1px solid rgba(137, 180, 250, 0.2);
}

.message-text pre {
  background: #1e1e2e;
  border: 1px solid rgba(137, 180, 250, 0.3);
  border-radius: 8px;
  padding: 1.2em;
  margin: 1.2em 0;
  overflow-x: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
  font-size: 0.85em;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  position: relative;
}

.message-text pre::before {
  content: attr(data-language);
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(137, 180, 250, 0.2);
  color: #89b4fa;
  padding: 0.3em 0.8em;
  font-size: 0.7em;
  border-bottom-left-radius: 6px;
  border-top-right-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.message-text pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  display: block;
  font-size: inherit;
  line-height: inherit;
}

/* highlight.js 主题适配 */
.message-text .hljs {
  background: transparent !important;
  padding: 0 !important;
}

/* 代码行号样式 */
.message-text pre .hljs-ln {
  border-collapse: collapse;
  width: 100%;
}

.message-text pre .hljs-ln td {
  padding: 0;
  border: none;
}

.message-text pre .hljs-ln-numbers {
  text-align: right;
  color: #6c7086;
  padding-right: 1em;
  user-select: none;
  border-right: 1px solid rgba(137, 180, 250, 0.2);
}

.message-text pre .hljs-ln-code {
  padding-left: 1em;
}

.message-text table {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
  background: rgba(137, 180, 250, 0.05);
  border-radius: 6px;
  overflow: hidden;
}

.message-text th,
.message-text td {
  border: 1px solid rgba(137, 180, 250, 0.2);
  padding: 0.8em;
  text-align: left;
}

.message-text th {
  background: rgba(137, 180, 250, 0.1);
  font-weight: 600;
}

.message-text a {
  color: #89b4fa;
  text-decoration: none;
}

.message-text a:hover {
  text-decoration: underline;
}

.message-text strong {
  color: #f5c2e7;
  font-size: 1.2em;
  font-weight: 600;
}

.message-text em {
  color: #f9e2af;
  font-style: italic;
}

.typing-indicator {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background: #7877c6;
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

.input-area {
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 2;
  background: rgba(30, 30, 46, 0.8);
  border: 1px solid rgba(120, 119, 198, 0.3);
  border-radius: 12px;
  display: flex;
  width: 95%;
  flex-direction: column;
  align-items: flex-end;
  margin: 20px 20px 0 20px;
}

textarea {
  flex: 1;
  background: rgba(30, 30, 46, 0.8);
  color: #e0e0e0;
  font-size: 14px;
  margin: 10px auto;
  width: 95%;
  border: none;
  resize: none;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  min-height: 50px;
  max-height: 120px;
  line-height: 1.5;
  font-family: inherit;
}



textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

textarea::placeholder {
  color: #888;
}

.send-button {
  border: none;
  cursor: pointer;
  width: 50px;
  height: 50px;
  transition: all 0.3s ease;
}

.send-button:hover:not(:disabled) {
  transform: scale(1.1);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.connection-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.warning-content {
  background: linear-gradient(135deg, #2d2d3d 0%, #3a3a4a 100%);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 16px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.warning-content h3 {
  color: #ff6b6b;
  margin-bottom: 15px;
  font-size: 18px;
}

.warning-content p {
  margin-bottom: 15px;
  color: #ccc;
}

.warning-content ul {
  text-align: left;
  margin: 15px 0;
  padding-left: 20px;
  color: #aaa;
}

.warning-content li {
  margin-bottom: 8px;
}

.warning-content button {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 15px;
}

.warning-content button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .messages-container {
    padding: 15px;
  }
  
  .content {
    max-width: 85%;
    padding: 12px 16px;
  }
  
  .input-area {
    padding: 15px;
  }
  
  .avatar {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .content {
    max-width: 90%;
  }
  
  .input-area {
    flex-direction: column;
    gap: 10px;
  }
  
  .send-button {
    width: 100%;
    min-width: auto;
  }
}

/* 下拉框样式 */
.model-select {
  background:transparent;
  border: none;
  border-radius: 8px;
  color: #afabab;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  min-width: 200px;
}


/* 自定义配置面板样式 */
.custom-config-panel {
  background: rgba(30, 30, 46, 0.9);
  border: 1px solid rgba(120, 119, 198, 0.3);
  border-radius: 12px;
  padding: 15px;
  margin-top: 10px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.config-input-group {
  margin-bottom: 12px;
}

.config-input-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: #aaa;
  font-weight: 500;
}

.config-input {
  width: 90%;
  background: rgba(45, 45, 61, 0.8);
  border: 1px solid rgba(120, 119, 198, 0.2);
  border-radius: 6px;
  color: #e0e0e0;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.config-input:focus {
  border-color: #7877c6;
  box-shadow: 0 0 10px rgba(120, 119, 198, 0.3);
}

.save-config-btn {
  background: linear-gradient(135deg, #7877c6 0%, #5a5a9a 100%);
  border: none;
  border-radius: 12px;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 50%;
}

.save-config-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(120, 119, 198, 0.3);
}

.save-config-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 模型信息显示样式 */
.model-info {
  font-size: 12px;
  color: #aaa;
  margin-left: 10px;
  padding: 4px 8px;
  background: rgba(120, 119, 198, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(120, 119, 198, 0.2);
}

/* 添加模型按钮样式 */
.add-model-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(30, 30, 46, 0.8);
  border: 1px solid rgba(120, 119, 198, 0.3);
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  margin-left: 10px;
}

.add-model-btn:hover {
  background: rgba(120, 119, 198, 0.2);
  border-color: rgba(120, 119, 198, 0.6);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(120, 119, 198, 0.3);
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3a 100%);
  border: 1px solid rgba(120, 119, 198, 0.3);
  border-radius: 16px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease-out;
  overflow: hidden;
}

.modal-header {
  padding: 20px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(120, 119, 198, 0.2);
  margin-bottom: 20px;
}

.modal-header h3 {
  margin: 0;
  color: #e0e0e0;
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 107, 107, 0.1);
  color: #ff6b6b;
}

.modal-body {
  padding: 0 24px;
}

.modal-footer {
  padding: 20px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(120, 119, 198, 0.2);
  margin-top: 20px;
}

/* 配置输入组样式 */
.config-input-group {
  margin-bottom: 12px;
}

.config-input-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: #aaa;
  font-weight: 500;
}

.config-input {
  width: 90%;
  background: rgba(45, 45, 61, 0.8);
  border: 1px solid rgba(120, 119, 198, 0.2);
  border-radius: 6px;
  color: #e0e0e0;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.config-input:focus {
  border-color: #7877c6;
  box-shadow: 0 0 10px rgba(120, 119, 198, 0.3);
}

/* 错误消息样式 */
.config-input-group .error-message {
  margin-top: 4px;
  padding: 6px 8px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 4px;
  font-size: 12px;
  color: #ff6b6b;
  animation: fadeIn 0.3s ease-out;
}

/* 当输入框有错误时的高亮样式 */
.config-input-group:has(.error-message) .config-input {
  border-color: #ff6b6b;
  box-shadow: 0 0 5px rgba(255, 107, 107, 0.3);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 15px 20px;
  }
  
  .modal-footer {
    flex-direction: column;
  }
}